home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / utils / sound / players / unix / olvm / olvwm33.snd < prev    next >
Encoding:
Text File  |  1993-01-31  |  5.0 KB  |  249 lines

  1. diff -r -c /tmp/olvwm3.3/Debug.c ./Debug.c
  2. *** /tmp/olvwm3.3/Debug.c    Sat Dec 12 09:27:01 1992
  3. --- ./Debug.c    Fri Dec 11 22:19:10 1992
  4. ***************
  5. *** 60,65 ****
  6. --- 60,69 ----
  7.       "ColormapNotify",
  8.       "ClientMessage",
  9.       "MappingNotify",
  10. + #ifdef    SOUNDS
  11. +     "Startup",
  12. +     "Shutdown",
  13. + #endif
  14.   };
  15.   
  16.   void
  17. ***************
  18. *** 99,101 ****
  19. --- 103,209 ----
  20.               typeNames[win->core.kind]);
  21.       (void) fflush(stderr);
  22.   }
  23. + #ifdef SOUNDS
  24. + #include <rplay.h>
  25. + #include <string.h>
  26. + #include <stdio.h>
  27. + #define    NEVENTS        (sizeof(eventNames) / sizeof(char *))
  28. + RPLAY    *rp[NEVENTS];
  29. + static int    need_sound_init = 1;
  30. + static int    sound_fd = 0;
  31. + static int    sound_state = 1;
  32. + static sound_init()
  33. + {
  34. +     int    i;
  35. +     FILE    *fl;
  36. +     char    buffer[100];
  37. +     char    *token;
  38. +     char    hostname[200];
  39. +     need_sound_init = 0;
  40. +     if (sound_fd == 0)
  41. +     {
  42. +         gethostname(hostname, 200);
  43. +         if ((sound_fd = rplay_open(hostname)) < 0)
  44. +             rplay_perror("create");
  45. +     }
  46. +     /*
  47. +      * Destroy any old sounds
  48. +      */
  49. +     for (i = 0; i < NEVENTS; i++)
  50. +     {
  51. +         if (rp[i] != NULL)
  52. +             rplay_destroy(rp[i]);
  53. +         rp[i] = NULL;
  54. +     }
  55. +     /*
  56. +      * Now read the file which contains the sounds
  57. +      */
  58. +     fl = fopen(".olvwm-sounds", "r");
  59. +     if (fl == NULL)
  60. +         return;
  61. +     while (fgets(buffer, 100, fl) != NULL)
  62. +     {
  63. +         token = strtok(buffer, ": \t");
  64. +         if (token == NULL)
  65. +             continue;
  66. +         for (i = 0; i < NEVENTS; i++)
  67. +         {
  68. +             if (strcmp(token, eventNames[i]) == 0)
  69. +             {
  70. +                 token = strtok(NULL, " \t\r\n");
  71. +                 if (token == NULL)
  72. +                     continue;
  73. +                 rp[i] = rplay_create();
  74. +                 if (rp[i] == NULL)
  75. +                 {
  76. +                     rplay_perror("create");
  77. +                     continue;
  78. +                 }
  79. +                 if (rplay_set(rp[i],
  80. +                     RPLAY_PLAY,    token,
  81. +                     NULL) < 0)
  82. +                 {
  83. +                     rplay_perror("rplay");
  84. +                 }
  85. +             }
  86. +         }
  87. +     }
  88. +     fclose(fl);
  89. + }
  90. + play_sound(snd)
  91. + int    snd;
  92. + {
  93. +     if (sound_state == 0)
  94. +         return;
  95. +     if (need_sound_init)
  96. +         sound_init();
  97. +     if (rp[snd] == NULL)
  98. +         return;
  99. +     if (rplay(sound_fd, rp[snd]) < 0)
  100. +         rplay_perror("create");
  101. + }
  102. + toggle_sound()
  103. + {
  104. +     sound_state ^= 1;
  105. + }
  106. + reread_sounds()
  107. + {
  108. +     sound_init();
  109. + }
  110. + #endif
  111. diff -r -c /tmp/olvwm3.3/Makefile.sunpro ./Makefile.sunpro
  112. *** /tmp/olvwm3.3/Makefile.sunpro    Sat Dec 12 09:27:02 1992
  113. --- ./Makefile.sunpro    Sat Dec 12 08:20:29 1992
  114. ***************
  115. *** 33,40 ****
  116.   #
  117.   # You shouldn't need to change anything below this line
  118.   
  119. ! INC = -I${OPENWINHOME}/include
  120. ! CFLAGS = ${INC} ${DEBUG} -DOW_I18N_L3 -DSUNDAE -DSHAPE
  121.   
  122.   HEADERS = cmdstream.h cursors.h defaults.h environ.h events.h gettext.h \
  123.         globals.h group.h helpcmd.h i18n.h iconimage.h iconmask.h  \
  124. --- 33,40 ----
  125.   #
  126.   # You shouldn't need to change anything below this line
  127.   
  128. ! INC = -I${OPENWINHOME}/include -I/usr/local/include
  129. ! CFLAGS = ${INC} ${DEBUG} -DOW_I18N_L3 -DSUNDAE -DSHAPE -DSOUNDS
  130.   
  131.   HEADERS = cmdstream.h cursors.h defaults.h environ.h events.h gettext.h \
  132.         globals.h group.h helpcmd.h i18n.h iconimage.h iconmask.h  \
  133. ***************
  134. *** 53,59 ****
  135.       ol_button.c
  136.   
  137.   LDFLAGS = -L${OPENWINHOME}/lib
  138. ! LIBS = ${LDFLAGS} -lolgx -lX11 -lXext -ll -lm
  139.   
  140.   OBJS = ${SRCS:.c=.o} ${VERSION}
  141.   
  142. --- 53,59 ----
  143.       ol_button.c
  144.   
  145.   LDFLAGS = -L${OPENWINHOME}/lib
  146. ! LIBS = ${LDFLAGS} -lolgx -lX11 -lXext -ll -lm -lrplay
  147.   
  148.   OBJS = ${SRCS:.c=.o} ${VERSION}
  149.   
  150. diff -r -c /tmp/olvwm3.3/events.c ./events.c
  151. *** /tmp/olvwm3.3/events.c    Sat Dec 12 09:27:05 1992
  152. --- ./events.c    Fri Dec 11 22:21:34 1992
  153. ***************
  154. *** 160,165 ****
  155. --- 160,168 ----
  156.       if (GRV.PrintAll)
  157.           DebugEvent(event, "Dispatch - debug");
  158.   
  159. + #ifdef    SOUNDS
  160. +     play_sound(event->type);
  161. + #endif
  162.       saveTimestamp( event );
  163.   
  164.       if (winInfo == NULL)
  165. diff -r -c /tmp/olvwm3.3/olwm.c ./olwm.c
  166. *** /tmp/olvwm3.3/olwm.c    Sat Dec 12 09:27:13 1992
  167. --- ./olwm.c    Fri Dec 11 22:23:02 1992
  168. ***************
  169. *** 369,374 ****
  170. --- 369,377 ----
  171.   
  172.       sendSyncSignal();
  173.   
  174. + #ifdef    SOUNDS
  175. +     play_sound(35);
  176. + #endif
  177.       EventLoop( DefDpy );
  178.   
  179.       /*NOTREACHED*/
  180. ***************
  181. *** 569,574 ****
  182. --- 572,580 ----
  183.       
  184.       SlaveStop();
  185.       ListApply(ActiveClientList, ClientShutdown, (void *)0);
  186. + #ifdef    SOUNDS
  187. +     play_sound(36);
  188. + #endif
  189.       XSync(dpy, True);
  190.       exit(0);
  191.       /*NOTREACHED*/
  192. diff -r -c /tmp/olvwm3.3/usermenu.c ./usermenu.c
  193. *** /tmp/olvwm3.3/usermenu.c    Sat Dec 12 09:27:18 1992
  194. --- ./usermenu.c    Fri Dec 11 22:25:28 1992
  195. ***************
  196. *** 190,195 ****
  197. --- 190,199 ----
  198.   extern int  GenDirMenuFunc();
  199.   extern int  StickSelnFunc();
  200.   extern int  MoveDesktopFunc();
  201. + #ifdef    SOUNDS
  202. + extern int  toggle_sound();
  203. + extern int  reread_sounds();
  204. + #endif
  205.   
  206.   /* ---------------------------------------------------------------------
  207.    *    local forward declarations
  208. ***************
  209. *** 1334,1340 ****
  210.       },
  211.       {
  212.       "MOVE_DESKTOP", MoveDesktopFunc, ServiceToken
  213. !     }
  214.   };
  215.   
  216.   #define NSERVICES COUNT(svctokenlookup)
  217. --- 1338,1352 ----
  218.       },
  219.       {
  220.       "MOVE_DESKTOP", MoveDesktopFunc, ServiceToken
  221. !     },
  222. ! #ifdef    SOUNDS
  223. !     {
  224. !     "FLIPSOUND", toggle_sound, ServiceToken
  225. !     },
  226. !     {
  227. !     "REREADSOUNDS", reread_sounds, ServiceToken
  228. !     },
  229. ! #endif
  230.   };
  231.   
  232.   #define NSERVICES COUNT(svctokenlookup)
  233.